#pragma once

namespace xyl {
	
	template<class T, class Container = std::list<T>>
	class queue {
	public:
		void push(const T& val) { c.push_back(val); }
		void pop() { c.pop_front(); }
		T& back() { return c.back(); }
		const T& back()const { return c.back(); }
		T& front() { return c.front(); }
		const T& front()const { return c.front(); }
		size_t size()const { return c.size(); }
		bool empty()const { return c.empty(); }
	private:
		Container c;
	};

	void test_queue() {
		queue<int> q;
		q.push(1);
		q.push(2);
		q.push(3);
		q.push(4);
		while (!q.empty()) {
			cout << q.front() << ' ';
			q.pop();
		}
		cout << endl;
	}
}